home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / decs.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  3.4 KB  |  108 lines

  1. #! /bin/csh
  2. #  decs is a csh script to rebuild the declarative part of a Fortran program
  3. #  according to a template of options using ISTDS.
  4. #    (via the combined tool fragment ISTQD = ISTLX/ISTYP/ISTDS/ISTPL)
  5. #
  6. #
  7. #  Invocation:
  8. #
  9. #  decs decs_option_file Polish_option_file Fortran_source_file
  10. #
  11. #  decs_option_file is the name of a file containing template options, one per
  12. #  line.  If decs_option_file is "-" then default decs options will be used.
  13. #
  14. #  Polish_option_file is the name of a file containing Polish options used in
  15. #  reconstructing the transformed Fortran.  If Polish_option_file is "-"
  16. #  then default Polish options will be used.
  17. #
  18. #  Check command line validity.
  19. if ( $#argv < 3 ) then
  20. TOOLPACKPATH/toolpack1.2/util/echoerr \
  21. Invocation:
  22. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  23. TOOLPACKPATH/toolpack1.2/util/echoerr \
  24. decs decs_option_file Polish_option_file Fortran_source_file
  25. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  26. TOOLPACKPATH/toolpack1.2/util/echoerr \
  27. For information about decs_option_file, see Users\' Guide.
  28. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  29. TOOLPACKPATH/toolpack1.2/util/echoerr \
  30. 'Polish_option_file is created by using script "polx".'
  31. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  32. TOOLPACKPATH/toolpack1.2/util/echoerr \
  33. 'Note: "-" in place of either or both option files gives default options.'
  34. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  35. TOOLPACKPATH/toolpack1.2/util/echoerr \
  36. Transformed code is sent to standard output and may be redirected to a file.
  37. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  38.    exit
  39. endif
  40. #  "-" as decs_option_file gives default options.
  41. if ( $1 != - ) then
  42. #  Check that decs_option_file exists.
  43.    if ( -e $1 == 0 ) then
  44. TOOLPACKPATH/toolpack1.2/util/echoerr \
  45. "'$1' does not exist. '-' as the first argument gives default decs options."
  46.       exit
  47.    endif
  48. endif
  49. #  "-" as Polish_option_file gives default options.
  50. if ( $2 != - ) then
  51. #  Check that Polish_option_file exists.
  52.    if ( -e $2 == 0 ) then
  53. TOOLPACKPATH/toolpack1.2/util/echoerr \
  54. "'$2' does not exist. '-' as the second argument gives default Polish options."
  55.       exit
  56.    endif
  57. endif
  58. #  Check that Fortran_source_file exists.
  59. if ( -e $3 == 0 ) then
  60. TOOLPACKPATH/toolpack1.2/util/echoerr \
  61. "'$3' does not exist."
  62.    exit
  63. endif
  64. #
  65. #  Create PFS.  If PFS already exists, exit with an advisory message.
  66. #
  67. if ( -e _.TOOLPACK == 0 ) then
  68.    mkdir _.TOOLPACK
  69. else
  70. TOOLPACKPATH/toolpack1.2/util/echoerr \
  71. Toolpack-created directory '"_.TOOLPACK"' exists. \
  72. Remove with script '"discard"'.
  73.    exit
  74. endif
  75. #  Make a tab-free copy of the Fortran source and use it as source.
  76. set src = qd.src$$
  77. expand $3 > _.TOOLPACK/$src
  78. #  Create the inter-process file IST.CMD and append parameters for ISTQD.
  79. if ( $1 == - ) then
  80.    set decsoptfile = 'mode=rebuild_declaratives'
  81. else
  82.    set decsoptfile = `cat $1`
  83. endif
  84. if ( $2 == - ) then
  85. TOOLPACKPATH/toolpack1.2/util/mkipf \
  86. $src \#1 "$decsoptfile" -
  87. else
  88. TOOLPACKPATH/toolpack1.2/util/mkipf \
  89. $src \#1 "$decsoptfile" \#$2
  90. endif
  91. #
  92. #  Invoke ISTQD.
  93. #
  94. TOOLPACKPATH/toolpack1.2/exec/istqd.u
  95. #
  96. #  If tool terminated with errors, advise user to obtain listing.
  97. if ( `cat _.TOOLPACK/_.info` == -1 ) then
  98. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  99. TOOLPACKPATH/toolpack1.2/util/echoerr \
  100. 'Errors detected.  Invoke script "getlst" to obtain a listing showing'
  101. TOOLPACKPATH/toolpack1.2/util/echoerr \
  102. statement and token numbers.
  103. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  104. endif
  105. #
  106. /bin/rm -r _.TOOLPACK
  107. #
  108.